-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TRA 14646] - Ajout de courtier/négociant sur BSVHU #3645
base: dev
Are you sure you want to change the base?
Conversation
…ory, remove useless logs
…e from generic company factory
@@ -417,7 +417,7 @@ export function toIncomingWaste(bsda: RegistryBsda): Required<IncomingWaste> { | |||
traderRecepisseNumber: null, | |||
brokerCompanyName: bsda.brokerCompanyName, | |||
brokerCompanySiret: bsda.brokerCompanySiret, | |||
brokerRecepisseNumber: null, | |||
brokerRecepisseNumber: bsda.brokerRecepisseNumber, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ajout de valeur manquante, je m'en suis rendu compte en regardnt ce qui était fait côté BSDA
orgIdGetter: () => { | ||
const orgId = getTransporterCompanyOrgId({ | ||
transporterCompanySiret: | ||
bsd.transporters![idx].transporterCompanySiret ?? null, | ||
transporterCompanyVatNumber: | ||
bsd.transporters![idx].transporterCompanyVatNumber ?? null | ||
}); | ||
return orgId ?? null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
petite différence avec les accesseurs sirenify, on a une fonction pour récup l'orgId au lieu de juste un champ "siret" pour gérer les récupérations d'orgId qui sont soit vat soit siret comme ici
@@ -725,8 +725,7 @@ export const bsdaEditionRules: BsdaEditionRules = { | |||
sealed: { from: "OPERATION" } | |||
}, | |||
brokerRecepisseValidityLimit: { | |||
readableFieldName: | |||
"la date de validité de la certification de l'entreprise de travaux", | |||
readableFieldName: "la date de validité du récépissé du courtier", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wording qui n'était pas le bon, remarqué en regardant ce qui était fait côté BSDA
@@ -292,7 +292,7 @@ export const contextualSchemaAsync = (context: BsdaValidationContext) => { | |||
// `enableCompletionTransformers=false`; | |||
transformedSyncSchema | |||
.transform(sirenifyBsda(context)) | |||
.transform(updateTransportersRecepisse) | |||
.transform(recipifyBsda(context)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utilisation du nouveau recipify
}, | ||
wasteVehiclesTypes: { | ||
set: ["BROYEUR", "DEMOLISSEUR"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
En raison de l'ajout de la validation du sous profil qui n'était pas faite alors que ça devrait être le cas, j'ai dû ajouter la définition de sous profil dans plein de tests
@@ -295,12 +300,80 @@ export function BsvhuPdf({ bsvhu, qrCode, renderEmpty }: Props) { | |||
</div> | |||
<div></div> | |||
</div> | |||
{/* End Emitter signature*/} | |||
{/* End Emitter signature */} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ajout de trader et broker au pdf. Si il n'y a ni l'un ni l'autre, laisser l'encart vide, si un seul des 2 cocher la case correspondante et afficher 1 encart, si i ly a les 2 afficher un encart supplémentaire pour le broker
@@ -38,7 +40,7 @@ export const checkCompanies: Refinement<ParsedZodBsvhu> = async ( | |||
await isDestinationRefinement( | |||
bsvhu.destinationCompanySiret, | |||
zodContext, | |||
"WASTE_VEHICLES" | |||
bsvhu.destinationType ?? "WASTE_VEHICLES" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
passage du type de destination attendu à la validation de destination pour voir si ça correspond au sous profil de l'entreprise
isExemptedFromVerification?: (destination: Company | null) => boolean | ||
) { | ||
const company = await refineSiretAndGetCompany( | ||
siret, | ||
ctx, | ||
CompanyRole.Destination | ||
); | ||
if (company) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changement de la validation de destination pour checker les sous profils VHU
@@ -134,3 +135,73 @@ export async function getTransporterReceipt( | |||
transporterRecepisseValidityLimit: transporterReceipt?.validityLimit ?? null | |||
}; | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fonction commune de recipify, à laquelle sont passé les accesseurs, basée sur la même architecture que sirenify. La petite différence est que ici on doit aller chercher les recepisse qui peuvent être de type différent (transporteur, trader, broker) donc il y a la gestion des différents cas
Quality Gate passedIssues Measures |
Objectif
Bonus
J'ai remplacé les recipify sur BSDA et BSFF avec ce nouveau recipify pour l'homogénéité (càd les bordereaux avec validation Zod, sauf PAOH qui a une validation assez différente des autres)